{% extends "scrum/base.html" %}
{%load static%}

{% block title %}WEEK{% endblock %}


{% block content %}

  <div style="margin-top: 10px; color: #ff6347;">选择负责人查看周报</div>


  <div class="showBlock">

    <select class="form-select" aria-label="multiple select example" id="user_id" onchange="selectOnchang()">

        {% if user == None%}

            <option value='' selected>点击菜单请选择人员查看周报情况</option>
        {% else%}

            <option value=''>点击菜单请选择人员查看周报情况</option>

        {% endif %}
  
        {% for user_now in all_user%}

            {% if user.id == user_now.id %}
  
                <option value={{user_now.id}} selected>{{user_now.username}}</option>

            {% else %}

                <option value={{user_now.id}}>{{user_now.username}}</option>

            {% endif %}
  
        {% endfor %}
  
    </select>

  </div>

    










<div class="showBlock">

    <h3>本周工作内容</h3>　

<table class="table table-hover text-nowrap align-middle">
<thead>
  <tr>
    <th scope="col">#</th>
    <th scope="col">项目</th>
    <th scope="col">分项</th>
    <th scope="col">开始时间</th>
    <th scope="col">预计结束</th>
    <th scope="col">结束时间</th>
    <th scope="col">负责人</th>
    <th scope="col">状态</th>
  </tr>
</thead>
<tbody>

  {% for product_backlog in this_week_list %}

    <!-- {% if product_backlog.status == 0 %}

    <tr onclick="showProductBacklogs({{product_backlog.id}})"  title="{{product_backlog.goal}}" style="color: red;">

    {% elif product_backlog.status == 1 %}

    <tr onclick="showProductBacklogs({{product_backlog.id}})"  title="{{product_backlog.goal}}" style="color: #ff6347;">

    {% elif product_backlog.status == 3 %}
    
    <tr onclick="showProductBacklogs({{product_backlog.id}})"  title="{{product_backlog.goal}}" style="color: green;">

    {% else %} -->
    
    <tr onclick="showProductBacklogs({{product_backlog.id}})"  title="{{product_backlog.goal}}">

    <!-- {% endif %} -->
    <th scope="row">{{product_backlog.id}}</th>
    <td>{{product_backlog.product.product}}</td>
    <td>{{product_backlog.product_backlog}}</td>
    <td>{{product_backlog.start_date}}</td>
    <td>{{product_backlog.end_date}}</td>
    <td>{{product_backlog.completion_date}}</td>
    <td>{{product_backlog.responsible.username}}</td>

    <td>

    {% if product_backlog.operation == 0 %}

    <span style="color: red;">撤销</span>

    {% elif product_backlog.operation == 1 %}


    <span style="color: #ff6347;">等待</span>

    
    {% elif product_backlog.operation == 2 %}


    <span style="color: #0d6efd;">进行中</span>


    

    {% elif product_backlog.operation == 3 %}
    
    <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="currentColor" class="bi bi-check-circle" viewBox="0 0 18 18" color="green">
        <path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"/>
        <path d="M10.97 4.97a.235.235 0 0 0-.02.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-1.071-1.05z"/>
    </svg>
    {% endif %}


    </td>
  </tr>
  {% endfor %}


  <tr>
    <td>－</td>
    <td>－</td>
    <td>－</td>
    <td>－</td>
    <td>－</td>
    <td>－</td>
    <td>－</td>
    <td>－</td>
  </tr>
</tbody>
</table>


</div>



<div class="showBlock">


        <h3>上周工作内容</h3>　

<table class="table table-hover text-nowrap align-middle">
    <thead>
      <tr>
        <th scope="col">#</th>
        <th scope="col">项目</th>
        <th scope="col">分项</th>
        <th scope="col">开始时间</th>
        <th scope="col">预计结束</th>
        <th scope="col">结束时间</th>
        <th scope="col">负责人</th>
        <th scope="col">状态</th>
      </tr>
    </thead>
    <tbody>

      {% for product_backlog in last_week_list %}

        <!-- {% if product_backlog.status == 0 %}

        <tr onclick="showProductBacklogs({{product_backlog.id}})"  title="{{product_backlog.goal}}" style="color: red;">

        {% elif product_backlog.status == 1 %}

        <tr onclick="showProductBacklogs({{product_backlog.id}})"  title="{{product_backlog.goal}}" style="color: #ff6347;">

        {% elif product_backlog.status == 3 %}
        
        <tr onclick="showProductBacklogs({{product_backlog.id}})"  title="{{product_backlog.goal}}" style="color: green;">

        {% else %} -->
        
        <tr onclick="showProductBacklogs({{product_backlog.id}})"  title="{{product_backlog.goal}}">

        <!-- {% endif %} -->
        <th scope="row">{{product_backlog.id}}</th>
        <td>{{product_backlog.product.product}}</td>
        <td>{{product_backlog.product_backlog}}</td>
        <td>{{product_backlog.start_date}}</td>
        <td>{{product_backlog.end_date}}</td>
        <td>{{product_backlog.completion_date}}</td>
        <td>{{product_backlog.responsible.username}}</td>

        <td>

        {% if product_backlog.operation == 0 %}

        <span style="color: red;">撤销</span>

        {% elif product_backlog.operation == 1 %}


        <span style="color: #ff6347;">等待</span>

        
        {% elif product_backlog.operation == 2 %}
    

        <span style="color: #0d6efd;">进行中</span>


        

        {% elif product_backlog.operation == 3 %}
        
        <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="currentColor" class="bi bi-check-circle" viewBox="0 0 18 18" color="green">
            <path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"/>
            <path d="M10.97 4.97a.235.235 0 0 0-.02.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-1.071-1.05z"/>
        </svg>
        {% endif %}


        </td>
      </tr>
      {% endfor %}

      <tr>
        <td>－</td>
        <td>－</td>
        <td>－</td>
        <td>－</td>
        <td>－</td>
        <td>－</td>
        <td>－</td>
        <td>－</td>
      </tr>
    </tbody>
  </table>


</div>

<div class="showBlock">


    <h3>下周及未来工作计划</h3>　

<table class="table table-hover text-nowrap align-middle">
<thead>
  <tr>
    <th scope="col">#</th>
    <th scope="col">项目</th>
    <th scope="col">分项</th>
    <th scope="col">开始时间</th>
    <th scope="col">预计结束</th>
    <th scope="col">结束时间</th>
    <th scope="col">负责人</th>
    <th scope="col">状态</th>
  </tr>
</thead>
<tbody>
  {% for product_backlog in future_week_list %}

    <!-- {% if product_backlog.status == 0 %}

    <tr onclick="showProductBacklogs({{product_backlog.id}})"  title="{{product_backlog.goal}}" style="color: red;">

    {% elif product_backlog.status == 1 %}

    <tr onclick="showProductBacklogs({{product_backlog.id}})"  title="{{product_backlog.goal}}" style="color: #ff6347;">

    {% elif product_backlog.status == 3 %}
    
    <tr onclick="showProductBacklogs({{product_backlog.id}})"  title="{{product_backlog.goal}}" style="color: green;">

    {% else %} -->
    
    <tr onclick="showProductBacklogs({{product_backlog.id}})"  title="{{product_backlog.goal}}">

    <!-- {% endif %} -->
    <th scope="row">{{product_backlog.id}}</th>
    <td>{{product_backlog.product.product}}</td>
    <td>{{product_backlog.product_backlog}}</td>
    <td>{{product_backlog.start_date}}</td>
    <td>{{product_backlog.end_date}}</td>
    <td>{{product_backlog.completion_date}}</td>
    <td>{{product_backlog.responsible.username}}</td>

    <td>

    {% if product_backlog.operation == 0 %}

    <span style="color: red;">撤销</span>

    {% elif product_backlog.operation == 1 %}


    <span style="color: #ff6347;">等待</span>

    
    {% elif product_backlog.operation == 2 %}


    <span style="color: #0d6efd;">进行中</span>


    

    {% elif product_backlog.operation == 3 %}
    
    <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="currentColor" class="bi bi-check-circle" viewBox="0 0 18 18" color="green">
        <path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"/>
        <path d="M10.97 4.97a.235.235 0 0 0-.02.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-1.071-1.05z"/>
    </svg>
    {% endif %}


    </td>
  </tr>
  {% endfor %}

  <tr>
    <td>－</td>
    <td>－</td>
    <td>－</td>
    <td>－</td>
    <td>－</td>
    <td>－</td>
    <td>－</td>
    <td>－</td>
  </tr>
</tbody>
</table>


</div>


{% endblock %}


{% block script %}    

<style>
    .showBlock {
        margin-top: 10px;
    }
</style>

<script>
    function selectOnchang(){
        var val = $("#user_id").val()

        window.location.href = "?user_id=" + val

        console.log(val)
    }
</script>


{% endblock %}


